<%@page import="model.StudentModel" %>
<%@page import="java.util.*" %>

<% response.setContentType("text/html") ; %>
<% 
Integer id = new Integer(request.getParameter("id"));


HashMap app_info = (HashMap) StudentModel.getApplicationById(id);

Vector deg_info = (Vector) StudentModel.getDegreesByAppId(id);

Vector rev_info = (Vector) StudentModel.getReviewsByAppId(id);

%>

	Name: <%=app_info.get("firstName")%>

<%
	if( !app_info.get("miName").equals("") )
	{
%>
		<%=app_info.get("miName")%>

<% 	}

%>
	<%=app_info.get("lastName")%> <br />
	
	Citizenship: <%=app_info.get("citizenship")%><br />
	Residency: <%=app_info.get("residency")%><br />
	
<%
	if( app_info.get("residency").equals("United States") )
	{
%>
	  Address: <%=app_info.get("address")%>, <%=app_info.get("city")%>, <%=app_info.get("state")%> <br/>
	  <%=app_info.get("zipCode")%>, (<%=app_info.get("areaCode")%>) <%=app_info.get("phone")%><br />
	  
<%
	}
	else
	{
%>
	  Street: <%=app_info.get("address")%><br />
	  City: <%=app_info.get("city")%><br />
	  Country Telephone Code: <%=app_info.get("countryCode")%>
	  Phone: <%=app_info.get("phone")%><br />
	  
<%
	}
%>
	<br/>Degrees:
<% 
	//get the degrees until empty
	while(!deg_info.isEmpty()){
		HashMap deg_items = (HashMap) deg_info.firstElement();
%>
		<p>
		University: <%=deg_items.get("university") %> <br/>
		Discipline: <%=deg_items.get("discipline") %>, <%=deg_items.get("title") %> <br/>
		Date Completed:</b> <%=deg_items.get("month") %>, <%=deg_items.get("year") %> <br/>
		GPA: <%=deg_items.get("gpa") %>
		</p>
		
		<%  //remove the first element
		deg_info.remove(0); 
	}
	
%>
	Specialization: <%=app_info.get("specialization")%> <br/>
	
	<br/>Reviews:
<%
	//get the degrees until empty
	while(!rev_info.isEmpty()){
		HashMap rev_items = (HashMap) rev_info.firstElement();
%>
	<p>
	Grade: <%=rev_items.get("grade") %> <br/>
	Comment: <%=rev_items.get("comment") %>
	</p>
	
	<%  //remove the first element
	rev_info.remove(0); 
}

%>
	
	<% /* Get grades and comments */ %>



